예외 로깅 레벨 4xx/5xx 분리#246
Open
ckdals4600 wants to merge 1 commit into
Open
Conversation
📊 코드 커버리지 리포트
|
Goder-0
reviewed
Jun 21, 2026
Comment on lines
26
to
33
| @ExceptionHandler(NoResourceFoundException.class) | ||
| public ResponseEntity<Void> handleNoResourceFound(NoResourceFoundException exception) { | ||
| if (exception.getResourcePath().contains("favicon")) { | ||
| return ResponseEntity.notFound().build(); | ||
| } | ||
| log.error("No static resource {}", exception.getResourcePath(), exception); | ||
| return ResponseEntity.notFound().build(); | ||
| } |
Contributor
There was a problem hiding this comment.
4xx/5xx 분리 정책이라면 NoResourceFoundException 도 같이 내려가는 게 맞아 보입니다. 지금은 정적 리소스 404 가 아직 ERROR + stack trace 로 남아서 운영 노이즈가 계속 생길 수 있습니다.`
Contributor
Author
There was a problem hiding this comment.
정적 리소스 404(NoResourceFoundException)도 다른 4xx 핸들러와 동일하게 log.warn 한 줄로 내리고 스택트레이스를 제거했습니다.
favicon만 따로 분기하던 부분에 대해서도 삭제하였습니다.
fd18b29 to
2c0b406
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
PR 설명
배경
log.error(ex.getMessage(), ex)로 동일하게 로깅하여,클라이언트 잘못인 4xx(검증 실패, 405, 404 등)까지 ERROR + 풀스택으로 기록됨.
Request method 'POST' is not supported,채팅을 찾을 수 없습니다등이 ERROR 로 다수 확인됨.적용된 로깅 원칙
변경 사항
WARN, 스택 트레이스 없이 핵심 필드만 기록BusinessException→ErrorCode.getStatus()로 분기: 5xx만 ERROR + 스택, 4xx는 WARNException(예상 못 한 5xx) →ERROR+ 풀스택 유지, 예외 객체를 인자로 전달